package mpcs.view
{
	import flash.events.Event;
	
	import mpcs.utils.ComponentManager;
	import mpcs.view.components.MainPanel;
	
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.mediator.Mediator;
	
	public class MainPanelMediator extends Mediator {
		
		public static const NAME:String = "MainPanelMediator";
		
		public function MainPanelMediator(viewComponent:MainPanel) {
			super(NAME, viewComponent);
		}
		
		override public function onRegister():void {
			mainPanel.addEventListener( MainPanel.CLICK_START, onStart );
		}
		
		/**打开开始请求**/
		private function onStart( event:Event ):void {
			trace("请求开始窗口 ... ");
			mainPanel.addElement( ComponentManager.getStartPanel() );
		}
		
		override public function listNotificationInterests():Array {
			return [];
		}
		
		override public function handleNotification( note:INotification ):void {
			
		}
		
		private function get mainPanel ():MainPanel {
			return viewComponent as MainPanel;
		}
	}
}